package com.mby.utils;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import static java.lang.System.in;

public class WebConstant {
	public static Properties props = new Properties();

	static {
		try {
			InputStream ins = Thread.currentThread().getContextClassLoader().getResourceAsStream("web-constant.properties");
			props.load(new InputStreamReader(ins, "utf-8"));
			ins.close();
		} catch (Exception e) {
			e.printStackTrace();
		}

		// 設定參數
		DMS_LOGIN_URL = props.getProperty("DMS_LOGIN_URL", "");
		DMS_USER_URL = props.getProperty("DMS_USER_URL", "");
		CS_MSG_URL = props.getProperty("CS_MSG_URL", "");
		EVHC_DB_PATH = props.getProperty("EVHC_DB_PATH", "");
		EVHC_DB_PORT = Integer.parseInt(props.getProperty("EVHC_DB_PORT", ""));
		EVHC_DB_NAME = props.getProperty("EVHC_DB_NAME", "");
		CS_DB_PATH = props.getProperty("CS_DB_PATH", "");
		CS_DB_PORT = Integer.parseInt(props.getProperty("CS_DB_PORT", ""));
		CS_DB_NAME = props.getProperty("CS_DB_NAME", "");

		PUSH_PLATFORM_IOS = "ios";
		PUSH_PLATFORM_ANDROID = "android";

		LIVE_ACCESSID_ANDROID = 2100294489L; //直播间安卓
		LIVE_SECRETKEY_ANDROID = "6be855a67656162c31c3692aca03b8a4"; //直播间安卓

		LIVE_ACCESSID_IOS = 2200294419L; //直播间IOS
		LIVE_SECRETKEY_IOS = "8fa61f5a925fcfad6d9acadcfc753a33"; //直播间IOS

		CS_ACCESSID_IOS = new HashMap<>();
		CS_ACCESSID_ANDROID = new HashMap<>();
		CS_SECRETKEY_IOS = new HashMap<>();
		CS_SECRETKEY_ANDROID = new HashMap<>();
		WebConstant.CS_ACCESSID_IOS.put(1,2200273480L); //捷豹
		WebConstant.CS_ACCESSID_IOS.put(2,2200269009L); //路虎
		WebConstant.CS_ACCESSID_ANDROID.put(1,2100274715L); //捷豹
		WebConstant.CS_ACCESSID_ANDROID.put(2,2100274714L); //路虎
		WebConstant.CS_SECRETKEY_IOS.put(1,"422a9dcfe8f66e385300f6e196e3cd90");
		WebConstant.CS_SECRETKEY_IOS.put(2,"2335a773ceb3d78abd17dd1d7d672325");
		WebConstant.CS_SECRETKEY_ANDROID.put(1,"0f76a7e82fdeea3e68199546e6353ae3");
		WebConstant.CS_SECRETKEY_ANDROID.put(2,"e9a067d5d57c2fb664333e09f66c543b");

		CS_VEHICLE_STATUS_MSG_CONTENT = props.getProperty("CS_VEHICLE_STATUS_MSG_CONTENT", "");
		CS_VEHICLE_EST15_TITLE = props.getProperty("CS_VEHICLE_EST15_TITLE", "");
		CS_VEHICLE_EST15_CONTENT = props.getProperty("CS_VEHICLE_EST15_CONTENT", "");
		CS_VEHICLE_STATUS_TITLE = props.getProperty("CS_VEHICLE_STATUS_TITLE", "");
		CS_VEHICLE_STATUS_CONTENT = props.getProperty("CS_VEHICLE_STATUS_CONTENT", "");
		CS_LIVE_START_TITLE = props.getProperty("CS_LIVE_START_TITLE", "");
		CS_LIVE_START_CONTENT = props.getProperty("CS_LIVE_START_CONTENT", "");
		CS_LIVE_END_TITLE = props.getProperty("CS_LIVE_END_TITLE", "");
		CS_LIVE_END_CONTENT = props.getProperty("CS_LIVE_END_CONTENT", "");
		PUSH_ENV = Integer.parseInt(props.getProperty("PUSH_ENV", "2"));
		APP_ENV = props.getProperty("APP_ENV", "dev");
		APP_SECRET = props.getProperty("APP_SECRET", "");
		APP_KEY = props.getProperty("APP_KEY", "");
		CHATGROUP_DETAIL_PATH = props.getProperty("CHATGROUP_DETAIL_PATH", "");
	}

	/**
	 * push相关
	 */
	public final static String APP_KEY;
	public final static String APP_SECRET;
	public final static String APP_ENV;
	public final static int PUSH_ENV;

	public final static long LIVE_ACCESSID_ANDROID;
	public final static String LIVE_SECRETKEY_ANDROID;

	public final static long LIVE_ACCESSID_IOS;
	public final static String LIVE_SECRETKEY_IOS;

	public final static String CS_VEHICLE_EST15_TITLE;
	public final static String CS_VEHICLE_EST15_CONTENT;
	public final static String CS_VEHICLE_STATUS_TITLE;
	public final static String CS_VEHICLE_STATUS_CONTENT;
	public final static String CS_LIVE_START_TITLE;
	public final static String CS_LIVE_START_CONTENT;
	public final static String CS_LIVE_END_TITLE;
	public final static String CS_LIVE_END_CONTENT;
	public final static String CS_VEHICLE_STATUS_MSG_CONTENT;

	public final static String PUSH_PLATFORM_IOS;
	public final static String PUSH_PLATFORM_ANDROID;

	public final static Map<Integer,Long> CS_ACCESSID_IOS;
	public final static Map<Integer,Long> CS_ACCESSID_ANDROID;

	public final static Map<Integer,String> CS_SECRETKEY_IOS;
	public final static Map<Integer,String> CS_SECRETKEY_ANDROID;

	public final static String CHATGROUP_DETAIL_PATH;


	/** dms登录url **/
	public final static String DMS_LOGIN_URL;

	/** dms用户url **/
	public final static String DMS_USER_URL;

	/** CS发送消息url **/
	public final static String CS_MSG_URL;

	/** 新evhc数据库配置 **/
	public final static String EVHC_DB_PATH;
	public final static Integer EVHC_DB_PORT;
	public final static String EVHC_DB_NAME;

	/** CSAPP数据库配置 **/
	public final static String CS_DB_PATH;
	public final static Integer CS_DB_PORT;
	public final static String CS_DB_NAME;

}
